Imports cmplib01

Public Class frmVictoryConditions
    Inherits System.Windows.Forms.Form

    Public Event VictoryConditionSelected(ByRef vc As IVictoryCondition)

    Private ptrGameData As CampaignerGameData
    Friend WithEvents Panel2 As System.Windows.Forms.Panel
    Friend WithEvents lblCampaignData As System.Windows.Forms.Label
    Friend WithEvents Panel3 As System.Windows.Forms.Panel
    Friend WithEvents lblTurnData As System.Windows.Forms.Label
    Friend WithEvents lblCurrentTurns As System.Windows.Forms.Label
    Friend WithEvents lblTurnLength As System.Windows.Forms.Label
    Friend WithEvents Panel4 As System.Windows.Forms.Panel
    Friend WithEvents lblCampaignDescription As System.Windows.Forms.Label
    Friend WithEvents lblVict As System.Windows.Forms.Label
    Friend WithEvents Panel5 As System.Windows.Forms.Panel
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents lblEnemyAchievedVictory As System.Windows.Forms.Label
    Friend WithEvents lblAchievedVictory As System.Windows.Forms.Label
    Friend WithEvents pnlVictoryConditions As System.Windows.Forms.Panel
    Friend WithEvents lblFactionVictoryConditions As System.Windows.Forms.Label
    Private m_Victory As VictoryConditions
    Friend WithEvents pnlCharts As System.Windows.Forms.Panel
    Friend WithEvents lblCharts As System.Windows.Forms.Label
    Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
    Private _evictory As VictoryConditions

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents btnOK As System.Windows.Forms.Button
    Friend WithEvents pnlTopBorder As System.Windows.Forms.Panel
    Friend WithEvents imgVictoryIcons As System.Windows.Forms.ImageList
    Friend WithEvents txtVC As System.Windows.Forms.TextBox
    Friend WithEvents Panel1 As System.Windows.Forms.Panel
    Friend WithEvents lblCampaign As System.Windows.Forms.Label
    Friend WithEvents txtDescription As System.Windows.Forms.TextBox
    Friend WithEvents tvwVictoryConditions As System.Windows.Forms.TreeView
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmVictoryConditions))
        Me.btnOK = New System.Windows.Forms.Button
        Me.pnlTopBorder = New System.Windows.Forms.Panel
        Me.lblVict = New System.Windows.Forms.Label
        Me.txtVC = New System.Windows.Forms.TextBox
        Me.tvwVictoryConditions = New System.Windows.Forms.TreeView
        Me.imgVictoryIcons = New System.Windows.Forms.ImageList(Me.components)
        Me.Panel1 = New System.Windows.Forms.Panel
        Me.lblCampaign = New System.Windows.Forms.Label
        Me.txtDescription = New System.Windows.Forms.TextBox
        Me.Panel2 = New System.Windows.Forms.Panel
        Me.lblCampaignData = New System.Windows.Forms.Label
        Me.Panel3 = New System.Windows.Forms.Panel
        Me.lblTurnData = New System.Windows.Forms.Label
        Me.lblCurrentTurns = New System.Windows.Forms.Label
        Me.lblTurnLength = New System.Windows.Forms.Label
        Me.Panel4 = New System.Windows.Forms.Panel
        Me.lblCampaignDescription = New System.Windows.Forms.Label
        Me.Panel5 = New System.Windows.Forms.Panel
        Me.Label1 = New System.Windows.Forms.Label
        Me.lblEnemyAchievedVictory = New System.Windows.Forms.Label
        Me.lblAchievedVictory = New System.Windows.Forms.Label
        Me.pnlVictoryConditions = New System.Windows.Forms.Panel
        Me.lblFactionVictoryConditions = New System.Windows.Forms.Label
        Me.pnlCharts = New System.Windows.Forms.Panel
        Me.lblCharts = New System.Windows.Forms.Label
        Me.PictureBox1 = New System.Windows.Forms.PictureBox
        Me.pnlTopBorder.SuspendLayout()
        Me.Panel1.SuspendLayout()
        Me.Panel2.SuspendLayout()
        Me.Panel3.SuspendLayout()
        Me.Panel4.SuspendLayout()
        Me.Panel5.SuspendLayout()
        Me.pnlVictoryConditions.SuspendLayout()
        Me.pnlCharts.SuspendLayout()
        CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'btnOK
        '
        Me.btnOK.BackColor = System.Drawing.Color.LightSkyBlue
        Me.btnOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat
        Me.btnOK.Location = New System.Drawing.Point(441, 468)
        Me.btnOK.Name = "btnOK"
        Me.btnOK.Size = New System.Drawing.Size(75, 23)
        Me.btnOK.TabIndex = 20
        Me.btnOK.Text = "OK"
        Me.btnOK.UseVisualStyleBackColor = False
        '
        'pnlTopBorder
        '
        Me.pnlTopBorder.BackColor = System.Drawing.Color.SteelBlue
        Me.pnlTopBorder.Controls.Add(Me.lblVict)
        Me.pnlTopBorder.Location = New System.Drawing.Point(255, 49)
        Me.pnlTopBorder.Name = "pnlTopBorder"
        Me.pnlTopBorder.Size = New System.Drawing.Size(271, 23)
        Me.pnlTopBorder.TabIndex = 19
        '
        'lblVict
        '
        Me.lblVict.AutoSize = True
        Me.lblVict.Location = New System.Drawing.Point(5, 5)
        Me.lblVict.Name = "lblVict"
        Me.lblVict.Size = New System.Drawing.Size(91, 13)
        Me.lblVict.TabIndex = 1
        Me.lblVict.Text = "Victory Conditions"
        '
        'txtVC
        '
        Me.txtVC.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.txtVC.Location = New System.Drawing.Point(263, 370)
        Me.txtVC.Multiline = True
        Me.txtVC.Name = "txtVC"
        Me.txtVC.Size = New System.Drawing.Size(261, 92)
        Me.txtVC.TabIndex = 24
        '
        'tvwVictoryConditions
        '
        Me.tvwVictoryConditions.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tvwVictoryConditions.ImageIndex = 0
        Me.tvwVictoryConditions.ImageList = Me.imgVictoryIcons
        Me.tvwVictoryConditions.Location = New System.Drawing.Point(263, 176)
        Me.tvwVictoryConditions.Name = "tvwVictoryConditions"
        Me.tvwVictoryConditions.SelectedImageIndex = 0
        Me.tvwVictoryConditions.ShowLines = False
        Me.tvwVictoryConditions.ShowRootLines = False
        Me.tvwVictoryConditions.Size = New System.Drawing.Size(261, 188)
        Me.tvwVictoryConditions.TabIndex = 23
        '
        'imgVictoryIcons
        '
        Me.imgVictoryIcons.ImageStream = CType(resources.GetObject("imgVictoryIcons.ImageStream"), System.Windows.Forms.ImageListStreamer)
        Me.imgVictoryIcons.TransparentColor = System.Drawing.Color.Transparent
        Me.imgVictoryIcons.Images.SetKeyName(0, "")
        Me.imgVictoryIcons.Images.SetKeyName(1, "")
        '
        'Panel1
        '
        Me.Panel1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.Panel1.BackColor = System.Drawing.Color.SteelBlue
        Me.Panel1.Controls.Add(Me.lblCampaign)
        Me.Panel1.Location = New System.Drawing.Point(3, 3)
        Me.Panel1.Name = "Panel1"
        Me.Panel1.Size = New System.Drawing.Size(529, 40)
        Me.Panel1.TabIndex = 20
        '
        'lblCampaign
        '
        Me.lblCampaign.AutoSize = True
        Me.lblCampaign.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblCampaign.ForeColor = System.Drawing.Color.Azure
        Me.lblCampaign.Location = New System.Drawing.Point(5, 12)
        Me.lblCampaign.Name = "lblCampaign"
        Me.lblCampaign.Size = New System.Drawing.Size(281, 20)
        Me.lblCampaign.TabIndex = 0
        Me.lblCampaign.Text = "Campaign: [show campaign name]"
        '
        'txtDescription
        '
        Me.txtDescription.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.txtDescription.Location = New System.Drawing.Point(15, 176)
        Me.txtDescription.Multiline = True
        Me.txtDescription.Name = "txtDescription"
        Me.txtDescription.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
        Me.txtDescription.Size = New System.Drawing.Size(229, 286)
        Me.txtDescription.TabIndex = 21
        '
        'Panel2
        '
        Me.Panel2.BackColor = System.Drawing.Color.SteelBlue
        Me.Panel2.Controls.Add(Me.lblCampaignData)
        Me.Panel2.Location = New System.Drawing.Point(3, 49)
        Me.Panel2.Name = "Panel2"
        Me.Panel2.Size = New System.Drawing.Size(241, 23)
        Me.Panel2.TabIndex = 22
        '
        'lblCampaignData
        '
        Me.lblCampaignData.AutoSize = True
        Me.lblCampaignData.Location = New System.Drawing.Point(9, 5)
        Me.lblCampaignData.Name = "lblCampaignData"
        Me.lblCampaignData.Size = New System.Drawing.Size(89, 13)
        Me.lblCampaignData.TabIndex = 0
        Me.lblCampaignData.Text = "Campaign Details"
        '
        'Panel3
        '
        Me.Panel3.BackColor = System.Drawing.Color.DarkSeaGreen
        Me.Panel3.Controls.Add(Me.lblTurnData)
        Me.Panel3.Location = New System.Drawing.Point(12, 78)
        Me.Panel3.Name = "Panel3"
        Me.Panel3.Size = New System.Drawing.Size(232, 23)
        Me.Panel3.TabIndex = 23
        '
        'lblTurnData
        '
        Me.lblTurnData.AutoSize = True
        Me.lblTurnData.Location = New System.Drawing.Point(9, 5)
        Me.lblTurnData.Name = "lblTurnData"
        Me.lblTurnData.Size = New System.Drawing.Size(34, 13)
        Me.lblTurnData.TabIndex = 0
        Me.lblTurnData.Text = "Turns"
        '
        'lblCurrentTurns
        '
        Me.lblCurrentTurns.BackColor = System.Drawing.Color.Gainsboro
        Me.lblCurrentTurns.Location = New System.Drawing.Point(15, 102)
        Me.lblCurrentTurns.Name = "lblCurrentTurns"
        Me.lblCurrentTurns.Size = New System.Drawing.Size(228, 23)
        Me.lblCurrentTurns.TabIndex = 24
        Me.lblCurrentTurns.Text = "Turn 4 of 60"
        Me.lblCurrentTurns.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'lblTurnLength
        '
        Me.lblTurnLength.BackColor = System.Drawing.Color.Gainsboro
        Me.lblTurnLength.Location = New System.Drawing.Point(15, 126)
        Me.lblTurnLength.Name = "lblTurnLength"
        Me.lblTurnLength.Size = New System.Drawing.Size(228, 23)
        Me.lblTurnLength.TabIndex = 25
        Me.lblTurnLength.Text = "15 minute turns"
        Me.lblTurnLength.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'Panel4
        '
        Me.Panel4.BackColor = System.Drawing.Color.DarkSeaGreen
        Me.Panel4.Controls.Add(Me.lblCampaignDescription)
        Me.Panel4.Location = New System.Drawing.Point(12, 151)
        Me.Panel4.Name = "Panel4"
        Me.Panel4.Size = New System.Drawing.Size(232, 23)
        Me.Panel4.TabIndex = 26
        '
        'lblCampaignDescription
        '
        Me.lblCampaignDescription.AutoSize = True
        Me.lblCampaignDescription.Location = New System.Drawing.Point(9, 5)
        Me.lblCampaignDescription.Name = "lblCampaignDescription"
        Me.lblCampaignDescription.Size = New System.Drawing.Size(110, 13)
        Me.lblCampaignDescription.TabIndex = 0
        Me.lblCampaignDescription.Text = "Campaign Description"
        '
        'Panel5
        '
        Me.Panel5.BackColor = System.Drawing.Color.DarkSeaGreen
        Me.Panel5.Controls.Add(Me.Label1)
        Me.Panel5.Location = New System.Drawing.Point(261, 78)
        Me.Panel5.Name = "Panel5"
        Me.Panel5.Size = New System.Drawing.Size(263, 23)
        Me.Panel5.TabIndex = 27
        '
        'Label1
        '
        Me.Label1.AutoSize = True
        Me.Label1.Location = New System.Drawing.Point(9, 5)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(34, 13)
        Me.Label1.TabIndex = 0
        Me.Label1.Text = "Turns"
        '
        'lblEnemyAchievedVictory
        '
        Me.lblEnemyAchievedVictory.BackColor = System.Drawing.Color.Gainsboro
        Me.lblEnemyAchievedVictory.Location = New System.Drawing.Point(264, 126)
        Me.lblEnemyAchievedVictory.Name = "lblEnemyAchievedVictory"
        Me.lblEnemyAchievedVictory.Size = New System.Drawing.Size(260, 23)
        Me.lblEnemyAchievedVictory.TabIndex = 29
        Me.lblEnemyAchievedVictory.Text = "Enemy Achieved Victory:"
        Me.lblEnemyAchievedVictory.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'lblAchievedVictory
        '
        Me.lblAchievedVictory.BackColor = System.Drawing.Color.Gainsboro
        Me.lblAchievedVictory.Location = New System.Drawing.Point(264, 102)
        Me.lblAchievedVictory.Name = "lblAchievedVictory"
        Me.lblAchievedVictory.Size = New System.Drawing.Size(260, 23)
        Me.lblAchievedVictory.TabIndex = 28
        Me.lblAchievedVictory.Text = "Achieved Victory:"
        Me.lblAchievedVictory.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'pnlVictoryConditions
        '
        Me.pnlVictoryConditions.BackColor = System.Drawing.Color.DarkSeaGreen
        Me.pnlVictoryConditions.Controls.Add(Me.lblFactionVictoryConditions)
        Me.pnlVictoryConditions.Location = New System.Drawing.Point(261, 151)
        Me.pnlVictoryConditions.Name = "pnlVictoryConditions"
        Me.pnlVictoryConditions.Size = New System.Drawing.Size(263, 23)
        Me.pnlVictoryConditions.TabIndex = 30
        '
        'lblFactionVictoryConditions
        '
        Me.lblFactionVictoryConditions.AutoSize = True
        Me.lblFactionVictoryConditions.Location = New System.Drawing.Point(9, 5)
        Me.lblFactionVictoryConditions.Name = "lblFactionVictoryConditions"
        Me.lblFactionVictoryConditions.Size = New System.Drawing.Size(135, 13)
        Me.lblFactionVictoryConditions.TabIndex = 0
        Me.lblFactionVictoryConditions.Text = "[Faction] Victory Conditions"
        '
        'pnlCharts
        '
        Me.pnlCharts.BackColor = System.Drawing.Color.SteelBlue
        Me.pnlCharts.Controls.Add(Me.lblCharts)
        Me.pnlCharts.Location = New System.Drawing.Point(532, 49)
        Me.pnlCharts.Name = "pnlCharts"
        Me.pnlCharts.Size = New System.Drawing.Size(268, 23)
        Me.pnlCharts.TabIndex = 31
        '
        'lblCharts
        '
        Me.lblCharts.AutoSize = True
        Me.lblCharts.Location = New System.Drawing.Point(5, 5)
        Me.lblCharts.Name = "lblCharts"
        Me.lblCharts.Size = New System.Drawing.Size(37, 13)
        Me.lblCharts.TabIndex = 1
        Me.lblCharts.Text = "Charts"
        '
        'PictureBox1
        '
        Me.PictureBox1.BackColor = System.Drawing.Color.WhiteSmoke
        Me.PictureBox1.Location = New System.Drawing.Point(534, 77)
        Me.PictureBox1.Name = "PictureBox1"
        Me.PictureBox1.Size = New System.Drawing.Size(257, 114)
        Me.PictureBox1.TabIndex = 32
        Me.PictureBox1.TabStop = False
        '
        'frmVictoryConditions
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.BackColor = System.Drawing.Color.Black
        Me.ClientSize = New System.Drawing.Size(526, 498)
        Me.Controls.Add(Me.PictureBox1)
        Me.Controls.Add(Me.pnlCharts)
        Me.Controls.Add(Me.pnlVictoryConditions)
        Me.Controls.Add(Me.lblEnemyAchievedVictory)
        Me.Controls.Add(Me.lblAchievedVictory)
        Me.Controls.Add(Me.Panel5)
        Me.Controls.Add(Me.tvwVictoryConditions)
        Me.Controls.Add(Me.txtVC)
        Me.Controls.Add(Me.Panel4)
        Me.Controls.Add(Me.lblTurnLength)
        Me.Controls.Add(Me.lblCurrentTurns)
        Me.Controls.Add(Me.Panel3)
        Me.Controls.Add(Me.Panel2)
        Me.Controls.Add(Me.txtDescription)
        Me.Controls.Add(Me.Panel1)
        Me.Controls.Add(Me.btnOK)
        Me.Controls.Add(Me.pnlTopBorder)
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
        Me.Name = "frmVictoryConditions"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.pnlTopBorder.ResumeLayout(False)
        Me.pnlTopBorder.PerformLayout()
        Me.Panel1.ResumeLayout(False)
        Me.Panel1.PerformLayout()
        Me.Panel2.ResumeLayout(False)
        Me.Panel2.PerformLayout()
        Me.Panel3.ResumeLayout(False)
        Me.Panel3.PerformLayout()
        Me.Panel4.ResumeLayout(False)
        Me.Panel4.PerformLayout()
        Me.Panel5.ResumeLayout(False)
        Me.Panel5.PerformLayout()
        Me.pnlVictoryConditions.ResumeLayout(False)
        Me.pnlVictoryConditions.PerformLayout()
        Me.pnlCharts.ResumeLayout(False)
        Me.pnlCharts.PerformLayout()
        CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub

#End Region

    Private Sub ShowDescription()
        Try
            If ptrGameData Is Nothing Then Exit Sub

            txtDescription.Text = ptrGameData.CampaignDescription
            lblCampaign.Text = ptrGameData.GameName

            lblCurrentTurns.Text = "Turn " & ptrGameData.Turn & " of " & ptrGameData.MaxTurns

            Select Case ptrGameData.TurnLength
                Case TurnLength_cgd.FiveMinute : lblTurnLength.Text = "5 minutes per turn"
                Case TurnLength_cgd.FifteenMinute : lblTurnLength.Text = "15 minutes per turn"
                Case TurnLength_cgd.HalfHour : lblTurnLength.Text = "30 minutes per turn"
                Case TurnLength_cgd.Hour : lblTurnLength.Text = "1 hour per turn"
                Case TurnLength_cgd.HalfDay : lblTurnLength.Text = "Half day per turn"
                Case TurnLength_cgd.FullDay : lblTurnLength.Text = "1 day per turn"
                Case TurnLength_cgd.Week : lblTurnLength.Text = "1 week per turn"
                Case TurnLength_cgd.Month : lblTurnLength.Text = "1 month per turn"
            End Select


        Catch ex As Exception
            HandleException("frmVictoryConditions.ShowDescription", ex)
        End Try
    End Sub

    Private Sub ShowEnemyVictory()
        Try
            Dim VictoryPoints As Integer
            Dim requiredPoints As Integer
            Dim victoryPercent As Integer

            Dim vict As IVictoryCondition

            For Each vict In _evictory

                If TypeOf vict Is FinalVictoryCondition Then
                    requiredPoints = vict.VPValue
                Else
                    If vict.Achieved = True Then
                        VictoryPoints += vict.VPValue
                    End If
                End If
            Next

            Try
                victoryPercent = (VictoryPoints / requiredPoints) * 100
            Catch ex As Exception
                victoryPercent = 0
            End Try

            lblEnemyAchievedVictory.Text = "Enemy Victory Points Achieved: " & VictoryPoints & "/" & requiredPoints & "    (" & victoryPercent & "%)"
        Catch ex As Exception
            HandleException("frmVictoryConditions.ShowEnemyVictory", ex)
        End Try
    End Sub

    Private Sub ShowVictory()
        If m_Victory Is Nothing Then Exit Sub

        Dim VictoryPoints As Integer
        Dim requiredPoints As Integer
        Dim victoryPercent As Integer

        Try
            Dim vict As IVictoryCondition

            For Each vict In m_Victory
                Dim victNode As New TreeNode
                If TypeOf vict Is FinalVictoryCondition Then
                    requiredPoints = vict.VPValue
                Else
                    victNode.Text = vict.VictoryConditionName & " (" & vict.VPValue & ")"
                    If vict.Achieved = True Then
                        VictoryPoints += vict.VPValue
                        victNode.SelectedImageIndex = 1
                        victNode.ImageIndex = 1
                    Else
                        victNode.SelectedImageIndex = 0
                        victNode.ImageIndex = 0
                    End If
                    ' place the VC in the tag so we can use it later.
                    victNode.Tag = vict
                    tvwVictoryConditions.Nodes.Add(victNode)
                End If

            Next

            Try
                victoryPercent = (VictoryPoints / requiredPoints) * 100
            Catch ex As Exception
                victoryPercent = 0
            End Try

            lblFactionVictoryConditions.Text = "[" & ptrGameData.selectedFaction.FactionName & "] Victory Conditions"
            lblAchievedVictory.Text = "Victory Points Achieved: " & VictoryPoints & "/" & requiredPoints & "    (" & victoryPercent & "%)"

        Catch ex As Exception
            HandleException("frmVictoryConditions.ShowVictory", ex)
        End Try
    End Sub

    Public Property GameData() As CampaignerGameData
        Get
            Return ptrGameData
        End Get
        Set(ByVal value As CampaignerGameData)
            ptrGameData = value
            ShowDescription()
        End Set
    End Property

    Public Property Victory() As VictoryConditions
        Get
            Return m_Victory
        End Get
        Set(ByVal Value As VictoryConditions)
            m_Victory = Value
            ShowVictory()
        End Set
    End Property

    Public Property EnemyVictory() As VictoryConditions
        Get
            Return _evictory
        End Get
        Set(ByVal value As VictoryConditions)
            _evictory = value
            ShowEnemyVictory()
        End Set
    End Property

    Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
        Me.Hide()
    End Sub

    Private Sub tvwVictoryConditions_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles tvwVictoryConditions.AfterSelect

        txtVC.Text = ""

        If tvwVictoryConditions.SelectedNode Is Nothing Then Exit Sub

        txtVC.Text = DirectCast(tvwVictoryConditions.SelectedNode.Tag, IVictoryCondition).Description

        RaiseEvent VictoryConditionSelected(tvwVictoryConditions.SelectedNode.Tag)

    End Sub


    Private Sub ShowVCDetails(ByVal vc As IVictoryCondition)

        txtVC.Text = vc.Description

    End Sub

    Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint
        e.Graphics.FillRectangle(Brushes.Blue, New RectangleF(20, PictureBox1.Height / 2, 15, 25))
    End Sub
End Class
